

var status = $('#status').val();

$('.collection').on('click',function(){
	if(parseInt(status) === 0){
		status = 4;
		$(this).find('img').attr('src',$(this).find('img').attr('data-y'));
	}else{
		status = 0;
		$(this).find('img').attr('src',$(this).find('img').attr('data-x'));
	}
	$.ajax({
		type : "POST",
		url : "/eshop/addOrCancelCollection.json",
		data:{"status":status,
			'saleEshopId':$('#saleEshopId').val()
			},
		dataType : "json",
		success:function(data){
			//window.location.href="/eshop/pcEshopList.htm?status="+status+"&saleEshopId"+$('#saleEshopId').val();
		}
	})
})

$('.pccollection').on('click',function(){
	if(parseInt(status) === 0){
		status = 4;
		$(this).find('img').attr('src',$(this).find('img').attr('data-y'));
	}else{
		status = 0;
		$(this).find('img').attr('src',$(this).find('img').attr('data-x'));
	}
	$.ajax({
		type : "POST",
		url : "/eshop/pcAddOrCancelCollection.htm",
		data:{"status":status,'saleEshopId':$('#saleEshopId').val()},
		dataType : "html",
		success:function(data){
			//window.location.href="/eshop/pcEshopList.htm?status="+status+"&saleEshopId"+$('#saleEshopId').val();
		}
	})
})